import {createRouter, createWebHistory, createWebHashHistory} from 'vue-router'
import { defineAsyncComponent } from 'vue'
import Config from '../views/Config.vue'
import Log from '../views/Log.vue'

const router = createRouter({ 
  // history: createWebHashHistory(process.env.BASE_URL,),  // hash 模式
  history: createWebHistory(),  // history 模式
  routes:[
    {
      path: '/',
      name: 'config',
      component:() => import('../views/Config.vue'),
      meta: {
        title: '首页',
      },
    },
    {
      path: '/log',
      name: 'log',
      component:() => import('../views/Log.vue'),
      meta: {
        title: '记录页',
      },
    },
    {
      path: '/*',
      redirect: '/',
    },
  ]
})


export default router
